package design_pattern.proxy;

public class ProxyImage implements Image {
    private RealImage image;
    @Override
    public void display(int second) {
        if(image==null){
            image=new RealImage();
        }
        System.out.println("下载当前图片");
        image.display(second/2);

    }

    public static void main(String[] args) {
        ProxyImage proxyImage=new ProxyImage();
        proxyImage.display(20);
    }
}
